<?php

namespace App\Models;



class CzHookSpec extends ApiBaseModel
{

    protected $table = 'cz_hook_spec';
    protected $fillable = [
        'spec_id',
        'province_id',
        'city_id',
        'condit',
        'act',
        'sort_type',
        'is_loop',
        'status',
        'create_by',
        'update_by',
    ];

    public function spec(){
        return $this->belongsTo(CzSpec::class,'spec_id','id');
    }
    public function channels(){
        return $this->hasMany(CzHookChannel::class,'hook_id','id');
    }
    public function product(){
        return $this->belongsTo(CzProduct::class,'product_id','id');
    }
    public function city(){
        return $this->belongsTo(Areas::class,'city_id','id');
    }
    public function province(){
        return $this->belongsTo(Areas::class,'province_id','id');
    }

}
